﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace eWallet
{
	internal static class InternalExtensions
	{

		internal static string GetProductName(this Assembly asm)
		{
			foreach (var item in asm.GetCustomAttributes(false))
			{
				if (item is AssemblyProductAttribute)
				{
					AssemblyProductAttribute a = (AssemblyProductAttribute)item;
					return a.Product;
				}
			}

			return null;
		}

		internal static IEnumerable<TOut> Convert<TIn, TOut>(this IEnumerable<TIn> input, Converter<TIn, TOut> converter)
		{
			List<TOut> list = new List<TOut>();
			foreach (var item in input)
			{
				list.Add(converter(item));
			}

			return list;
		}
	}
}
